<template>
  <el-select v-model="value" multiple @change="changes"  :placeholder="placeholder" clearable>
    <el-option :label="data.dictLabel" v-for="data in dataList" :key="data.dictValue" :value="data.dictValue">{{ data.dictLabel }}</el-option>
  </el-select>
</template>
<script lang="ts">
// @ts-nocheck
import { computed, defineComponent, watch,ref } from "vue";
import { getDictDataList } from "@/utils/utils";
import { useAppStore } from "@/store";
export default defineComponent({
  name: "RenSelect",
  props: {
    modelValue:Array,
    dictType: String,
    placeholder: String,
    multiple:String
  },
  setup(props,context) {
    const store = useAppStore();
    const value=ref([]);
    const changes=(e)=>{
      console.log(e);
       context.emit("updateSelectMore",e)
    
    }
    watch(()=>props.modelValue,
    ()=>{
      value.value=props.modelValue || [];
    },
    )
    return {
      value,
      dataList: getDictDataList(store.state.dicts, props.dictType),
      changes,
    };
  }
});
</script>
